{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { Portal } from 'react-portal';\nvar InputFiles = /*#__PURE__*/\nfunction (_React$PureComponent) {\n  _inheritsLoose(InputFiles, _React$PureComponent);\n  function InputFiles() {\n    var _this;\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    _this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;\n    _this.input = React.createRef();\n    _this.onClick = function (e) {\n      e.preventDefault();\n      var input = _this.input.current;\n      if (input) input.click();\n    };\n    _this.onChange = function (e) {\n      var onChange = _this.props.onChange;\n      onChange(e.target.files, e);\n    };\n    return _this;\n  }\n  var _proto = InputFiles.prototype;\n  _proto.render = function render() {\n    var _this$props = this.props,\n      children = _this$props.children,\n      accept = _this$props.accept,\n      style = _this$props.style,\n      multiple = _this$props.multiple;\n    var input = this.input,\n      onClick = this.onClick,\n      onChange = this.onChange;\n    return React.createElement(React.Fragment, null, React.createElement(\"div\", {\n      onClick: onClick,\n      onKeyPress: onClick,\n      role: \"button\",\n      tabIndex: \"0\",\n      style: _extends({\n        display: 'inline-block'\n      }, style)\n    }, children), React.createElement(Portal, null, React.createElement(\"input\", {\n      ref: input,\n      type: \"file\",\n      accept: accept,\n      onChange: onChange,\n      style: {\n        display: 'none'\n      },\n      multiple: multiple\n    })));\n  };\n  return InputFiles;\n}(React.PureComponent);\nInputFiles.defaultProps = {\n  accept: 'image/*'\n};\nprocess.env.NODE_ENV !== \"production\" ? InputFiles.propTypes = {\n  children: PropTypes.node.isRequired,\n  onChange: PropTypes.func,\n  // (files: Array<File>, e: SyntheticEvent<HTMLInputElement>) => void,\n  accept: PropTypes.string,\n  style: PropTypes.object,\n  // eslint-disable-line\n  multiple: PropTypes.bool\n} : void 0;\nexport default InputFiles;","map":{"version":3,"names":["_extends","_inheritsLoose","React","PropTypes","Portal","InputFiles","_React$PureComponent","_this","_len","arguments","length","args","Array","_key","call","apply","concat","input","createRef","onClick","e","preventDefault","current","click","onChange","props","target","files","_proto","prototype","render","_this$props","children","accept","style","multiple","createElement","Fragment","onKeyPress","role","tabIndex","display","ref","type","PureComponent","defaultProps","process","env","NODE_ENV","propTypes","node","isRequired","func","string","object","bool"],"sources":["/data/messenger.client/node_modules/react-input-files/es/InputFiles.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { Portal } from 'react-portal';\n\nvar InputFiles =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n  _inheritsLoose(InputFiles, _React$PureComponent);\n\n  function InputFiles() {\n    var _this;\n\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    _this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;\n    _this.input = React.createRef();\n\n    _this.onClick = function (e) {\n      e.preventDefault();\n      var input = _this.input.current;\n      if (input) input.click();\n    };\n\n    _this.onChange = function (e) {\n      var onChange = _this.props.onChange;\n      onChange(e.target.files, e);\n    };\n\n    return _this;\n  }\n\n  var _proto = InputFiles.prototype;\n\n  _proto.render = function render() {\n    var _this$props = this.props,\n        children = _this$props.children,\n        accept = _this$props.accept,\n        style = _this$props.style,\n        multiple = _this$props.multiple;\n    var input = this.input,\n        onClick = this.onClick,\n        onChange = this.onChange;\n    return React.createElement(React.Fragment, null, React.createElement(\"div\", {\n      onClick: onClick,\n      onKeyPress: onClick,\n      role: \"button\",\n      tabIndex: \"0\",\n      style: _extends({\n        display: 'inline-block'\n      }, style)\n    }, children), React.createElement(Portal, null, React.createElement(\"input\", {\n      ref: input,\n      type: \"file\",\n      accept: accept,\n      onChange: onChange,\n      style: {\n        display: 'none'\n      },\n      multiple: multiple\n    })));\n  };\n\n  return InputFiles;\n}(React.PureComponent);\n\nInputFiles.defaultProps = {\n  accept: 'image/*'\n};\nprocess.env.NODE_ENV !== \"production\" ? InputFiles.propTypes = {\n  children: PropTypes.node.isRequired,\n  onChange: PropTypes.func,\n  // (files: Array<File>, e: SyntheticEvent<HTMLInputElement>) => void,\n  accept: PropTypes.string,\n  style: PropTypes.object,\n  // eslint-disable-line\n  multiple: PropTypes.bool\n} : void 0;\nexport default InputFiles;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,MAAM,QAAQ,cAAc;AAErC,IAAIC,UAAU,GACd;AACA,UAAUC,oBAAoB,EAAE;EAC9BL,cAAc,CAACI,UAAU,EAAEC,oBAAoB,CAAC;EAEhD,SAASD,UAAU,GAAG;IACpB,IAAIE,KAAK;IAET,KAAK,IAAIC,IAAI,GAAGC,SAAS,CAACC,MAAM,EAAEC,IAAI,GAAG,IAAIC,KAAK,CAACJ,IAAI,CAAC,EAAEK,IAAI,GAAG,CAAC,EAAEA,IAAI,GAAGL,IAAI,EAAEK,IAAI,EAAE,EAAE;MACvFF,IAAI,CAACE,IAAI,CAAC,GAAGJ,SAAS,CAACI,IAAI,CAAC;IAC9B;IAEAN,KAAK,GAAGD,oBAAoB,CAACQ,IAAI,CAACC,KAAK,CAACT,oBAAoB,EAAE,CAAC,IAAI,CAAC,CAACU,MAAM,CAACL,IAAI,CAAC,CAAC,IAAI,IAAI;IAC1FJ,KAAK,CAACU,KAAK,GAAGf,KAAK,CAACgB,SAAS,EAAE;IAE/BX,KAAK,CAACY,OAAO,GAAG,UAAUC,CAAC,EAAE;MAC3BA,CAAC,CAACC,cAAc,EAAE;MAClB,IAAIJ,KAAK,GAAGV,KAAK,CAACU,KAAK,CAACK,OAAO;MAC/B,IA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